package client.container;

import java.util.concurrent.PriorityBlockingQueue;

/**
 * @author primianoc
 *
 */
public class FileCompletedContainer
{
	private PriorityBlockingQueue<String> _fileCompleted = null;
	private static FileCompletedContainer _instance= null;

	private FileCompletedContainer()
	{
		_fileCompleted = new PriorityBlockingQueue<String>();
	}

	public boolean isStreamCompleted(String streamName)
	{
		return _fileCompleted.contains(streamName);
	}

	public void setStreamCompleted(String streamName)
	{
		_fileCompleted.add(streamName);
	}

	public static FileCompletedContainer getInstance()
	{
		if(_instance == null)
		{
			_instance = new FileCompletedContainer();
		}

		return _instance;
	}

	public void reset()
	{
		_fileCompleted.clear();
	}

}
